let serve = ''
let customerServe = ''
let socket = ''

let imgUrl = ''
let upload = ''

let devVersion = wx.getStorageSync('devVersion')
console.log('devVersion==============================', devVersion)

const {
  miniProgram: {
    envVersion
  }
} = wx.getAccountInfoSync();
console.log(envVersion, 'envVersion=============')

switch (envVersion) {
  case 'develop': //开发环境
    if (!devVersion) {
      serve = 'https://test-api.jzdoctor.com'
      customerServe = 'https://testchatapi.jzdoctor.com:8080'
      socket = 'wss://testchatapi.jzdoctor.com:8080/'
      imgUrl = customerServe + '/files'
      upload = serve + '/common/review/file/uploadImage'
    } else {
      serve = 'https://api.jzdoctor.com'
      customerServe = 'https://chatapi.jzdoctor.com:8080'
      socket = 'wss://chatapi.jzdoctor.com:8080/'
      imgUrl = customerServe + '/files'
      upload = serve + '/common/review/file/uploadImage'
    }
    break;
  case 'trial': //体验版
    if (!devVersion) {
      serve = 'https://test-api.jzdoctor.com'
      customerServe = 'https://testchatapi.jzdoctor.com:8080'
      socket = 'wss://testchatapi.jzdoctor.com:8080/'
      imgUrl = customerServe + '/files'
      upload = serve + '/common/review/file/uploadImage'
    } else {
      serve = 'https://api.jzdoctor.com'
      customerServe = 'https://chatapi.jzdoctor.com:8080'
      socket = 'wss://chatapi.jzdoctor.com:8080/'
      imgUrl = customerServe + '/files'
      upload = serve + '/common/review/file/uploadImage'
    }
    break
  case 'release': //正式版
    serve = 'https://api.jzdoctor.com'
    customerServe = 'https://chatapi.jzdoctor.com:8080'
    socket = 'wss://chatapi.jzdoctor.com:8080/'

    imgUrl = customerServe + '/files'
    upload = serve + '/common/review/file/uploadImage'
    break;
}

export {
  customerServe,
  serve,
  imgUrl,
  upload,
  socket
}